package com.tanhua.manager.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanhua.manager.domain.Log;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface LogMapper extends BaseMapper<Log> {

    @Select("SELECT COUNT(DISTINCT user_id) FROM tb_log WHERE log_time = #{today} AND user_id IN(" +
            "SELECT user_id FROM tb_log t1 WHERE t1.log_time = #{yesterday} AND t1.type = '0102'" +
            ")")
    int queryRetentionCount(@Param("today") String today,@Param("yesterday") String yesterday);
}